<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "hy_branch_class".
 *
 * @property int $id
 * @property int $br_id 行业分馆id
 * @property int $cat_id1 一级分类id
 * @property int $cat_id2 二级分类id
 * @property int $status 状态
 * @property string $created_at 创建时间
 * @property string $updated_at 修改时间
 * @property string $deleted_at 删除时间
 */
class BranchClass extends \yii\db\ActiveRecord
{
    /**
     * 自动更新时间
     */
    public function behaviors()
    {
        return [
            [
                'class' => \yii\behaviors\TimestampBehavior::className(),
                'value' => function () {
                    return date('Y-m-d H:i:s');
                },
            ],
        ];
    }
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'hy_branch_class';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['br_id'], 'required'],
            [['br_id', 'cat_id1', 'cat_id2', 'status'], 'integer'],
            [['created_at', 'updated_at', 'deleted_at'], 'safe'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'br_id' => 'Br ID',
            'cat_id1' => 'Cat Id1',
            'cat_id2' => 'Cat Id2',
            'status' => 'Status',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'deleted_at' => 'Deleted At',
        ];
    }
}
